#include <iostream>
#include <string>

using namespace std;

int main()
{
    string s;
    cin >> s;
    int left = 0, right = (int)s.size() - 1;
    long long count = 1;
    while (left <= right)
    {
        if (s[left] != s[right] && s[left] != '?' && s[right] != '?')
            count *= 0;
        if (s[left] == s[right] && s[left] == '?')
            count = count * 26 % 1000000007;
        ++left;
        --right;
    }
    count %= 1000000007;
    cout << count << endl;
    return 0;
}